<?php

namespace api\modules\app\models;

use Yii;

/**
 * This is the model class for table "section".
 *
 * @property string $code
 * @property string $name
 * @property string $start
 * @property string $end
 * @property string $district_code
 * @property string $street_code
 * @property string $range
 * @property string $range_cd
 */
class Section extends \api\modules\app\models\BaseModel
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'section';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('test_3');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['code', 'name', 'start', 'end', 'range', 'range_cd'], 'required'],
            [['range', 'range_cd'], 'string'],
            [['code', 'district_code', 'street_code'], 'string', 'max' => 50],
            [['name', 'start', 'end'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'code' => 'Code',
            'name' => 'Name',
            'start' => 'Start',
            'end' => 'End',
            'district_code' => 'District Code',
            'street_code' => 'Street Code',
            'range' => 'Range',
            'range_cd' => 'Range Cd',
        ];
    }
}